package com.forum.dto;

import cn.hutool.core.date.DateTime;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

@Data
@TableName("user")
@JsonIgnoreProperties(ignoreUnknown = true)
public class UserDTO {
    @TableId
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;
    private String username;
    private String password;
    private Integer gender;
    private String birthday;
    private String phone;
    private String email;
    private String picture;
    private Integer state;
    private String context;
    private String title;
    private LocalDateTime createTime;
    private LocalDateTime updateTime;
    
    // 非数据库字段，用于传输用户角色信息
    private transient List<String> roles;
    
    // 主要角色代码
    private transient String role;
}